﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="client.aspx.cs" Inherits="client" ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div style="width:50%">
        <div class="div-box">
            <asp:Label ID="lbClient" runat="server" />
        </div>
        <div id="scratchpad" class="div-box">
            <asp:Label ID="lbScratchpad" runat="server" />
            <asp:ImageButton ID="btEditScratchpad" runat="server" CausesValidation="false"  ImageUrl="~/images/edit.gif" />  
            <ajax:modalpopupextender ID="mpEditScratchpad" runat="server" PopupControlID="pnEditScratchpad" TargetControlID="btEditScratchpad" BackgroundCssClass="modalBackground" />
        </div>
        <div id="instructions" class="div-box">
            <asp:Label ID="lbInstructions" runat="server" />
        </div>
        <div id="specific-instructions" class="div-box">
            <asp:DropDownList ID="ddSpecificInstructions" runat="server" AutoPostBack="true" OnDataBinding="ddSpecificInstructions_DataBinding" OnSelectedIndexChanged="ddSpecificInstructions_SelectedIndexChanged" />
            <asp:Label ID="lbSpecificInstructions" runat="server" />
        </div>
        <div style="margin:5px;">
            <ajax:TabContainer ID="tcClient" runat="server">
                <ajax:TabPanel ID="tpActiveMessages" runat="server" HeaderText="Active Messages">
                    <ContentTemplate>
                        <asp:ListView ID="lvMessages" runat="server" OnDataBinding="lvMessages_DataBinding">
                            <LayoutTemplate>
                                <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                            </LayoutTemplate>
                            <ItemTemplate>
                                <div>
                                    <span><%# Eval("CallerName") %></span><br />
                                    <span><%# Eval("CallerNumber") %></span><br />
                                    <span><%# Eval("Text") %></span><br />
                                </div>
                            </ItemTemplate>
                            <ItemSeparatorTemplate>
                                <br />
                            </ItemSeparatorTemplate>
                        </asp:ListView>                    
                    </ContentTemplate>
                </ajax:TabPanel>
                <ajax:TabPanel ID="tpRecentCalls" runat="server" HeaderText="Recent Calls">
                    <ContentTemplate>
                        <asp:ListView ID="lvRecentCalls" runat="server" OnDataBinding="lvRecentCalls_DataBinding">
                            <LayoutTemplate>
                                <table width="100%" style="text-align:center">
                                    <thead>
                                        <td>Type</td><td>Time</td><td>Number</td><td>Extension</td>
                                    </thead>
                                    <asp:PlaceHolder ID="itemPlaceholder" runat="server" />                                   
                                </table>
                            </LayoutTemplate>
                            <ItemTemplate>
                                <tr>
                                    <td><%# Eval("Outbound").Equals(true)?"Outbound":"Inbound" %></td>
                                    <td><asp:HyperLink ID="lkCall" runat="server" Text='<%# Eval("TimeStamp") %>' NavigateUrl='<%# "~/call.aspx?ID=" + Eval("CallID") %>' /></td>
                                    <td><asp:Label ID="lbNumber" runat="server" Text='<%# Eval("Number","{0:(###)###-####}") %>' /></td>
                                    <td><%# Eval("Login") %></td>
                                </tr>
                            </ItemTemplate>
                        </asp:ListView>            
                    </ContentTemplate>
                </ajax:TabPanel>
            </ajax:TabContainer>    
        </div>
    </div>

    <asp:Panel ID="pnEditScratchpad" runat="server" Style="display:none">
        <div style="background-color:#CCCCFF; border: solid 1px black; width:400px; padding:10px;">
            <p style="text-align:center">Edit Scratchpad</p>
            <asp:TextBox ID="tbEditScratchpad" runat="server" TextMode="MultiLine" Width="97%" Height="200px" />
            <asp:ImageButton ID="btUpdateScratchpad" runat="server" CausesValidation="false" ImageUrl="~/images/update.gif" OnClick="btUpdateScratchpad_Click" />
            &nbsp;<asp:ImageButton ID="btCancelEditAScratchpad" runat="server" ImageUrl="~/images/cancel.gif" />                    
        </div>
    </asp:Panel>
    
</asp:Content>

